﻿Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Workflow.ComponentModel

Namespace System.Workflow.ComponentModel.Design
    Public Class WorkflowOutlineNode
        Inherits TreeNode
        ' Methods
        Public Sub New(ByVal activity As Activity)
            If (activity Is Nothing) Then
                Throw New ArgumentNullException("activity")
            End If
            Me.activity = activity
            MyBase.Name = activity.Name
        End Sub

        Public Overridable Sub OnActivityRename(ByVal newName As String)
            MyBase.Text = newName
        End Sub

        Public Overridable Sub RefreshNode()
            Dim activity As Activity = Me.Activity
            If (Not activity Is Nothing) Then
                MyBase.ForeColor = If((Not activity.Enabled OrElse ActivityDesigner.IsCommentedActivity(activity)), WorkflowTheme.CurrentTheme.AmbientTheme.CommentIndicatorColor, SystemColors.WindowText)
                MyBase.Text = activity.Name
            End If
        End Sub


        ' Properties
        Public ReadOnly Property Activity As Activity
            Get
                Return Me.activity
            End Get
        End Property


        ' Fields
        Private activity As Activity
    End Class
End Namespace

